import request from '@/utils/request'

// 资产上传文件
export function upload(params) {
  return request({
    url: '/file/roomFileUpload.do',
    method: 'post',
    data: params
  })
}

// 通用上传文件
export function fileUpload(params) {
  return request({
    url: '/file/fileUpload.do',
    method: 'post',
    data: params
  })
}
// 获取文件列表
export function getFileMenu(data) {
  return request({
    url: '/menu/selectFileMenu.do?roomGuids=' + data.roomGuids + '&rootGuid=' + data.guid,
    method: 'get'
  })
}

// 删除文件图片
export function delFile(params) {
  return request({
    url: '/file/delFile.do',
    method: 'post',
    data: params
  })
}

// 文件图片下载
export function download(url) {
  return request({
    url: '/file/download.do?fileName=' + url,
    method: 'get'
  })
}

// 扫码传图
export function getcode() {
  return request({
    url: '/menu/selectFileMenu.do?roomGuids=',
    method: 'get'
  })
}
